package cn.yl.ad.server.controller;


import cn.yl.ad.server.entity.PromotionAd;
import cn.yl.ad.server.service.PromotionAdService;
import cn.yl.api.server.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 广告表 前端控制器
 * </p>
 *
 * @author yl
 * @since 2022-04-22
 */
@RestController
@RequestMapping("/ad")
public class PromotionAdController {

    @Autowired
    private PromotionAdService promotionAdService;

    @GetMapping("/getAdsBySpaceId/{spaceId}")
    public Result getListById(@PathVariable Integer spaceId){
        List<PromotionAd> list = promotionAdService.getAdsBySpaceId(spaceId);
        return Result.ok().setData("items",list);
    }

}

